#include <stdio.h>
#include <stdlib.h>

int main(int argc, char const *argv[])
{
    FILE *fp;
    char ch;
    char *fileName;
    printf("please input the filename you want to write: ");
    scanf("%s", fileName);

    if(!(fp = fopen(fileName, "wt+"))   )
    {
     printf("can't open the file!\n");
     exit(0);
    }

    printf("please input the sentences you want to write: \n");
    ch = getchar();
    ch = getchar();

    while(ch!=EOF){
    	fputc(ch,fp);
    	ch = getchar();
    }
    fclose(fp);
    return 0;
}